package com.hotel.system.service.impl;

import com.hotel.common.utils.ShiroUtils;
import com.hotel.system.domain.hotel.Expenses;
import com.hotel.system.domain.hotel.Property;
import com.hotel.system.mapper.ExpensesMapper;
import com.hotel.system.mapper.PropertyMapper;
import com.hotel.system.mapper.SysUserPostMapper;
import com.hotel.system.service.ExpensesService;
import com.hotel.system.service.PropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * 岗位信息 服务层处理
 * 
 * @author hotel
 */
@Service
public class PropertyServiceImpl implements PropertyService
{


    @Autowired
    private PropertyMapper propertyMapper;

    @Autowired
    private SysUserPostMapper userPostMapper;



    @Override
    public List<Property> selectPropertyList(Property property) {
        return propertyMapper.selectPropertyList(property);
    }
    @Override
    public int insertProperty(Property property)
    {
        property.setDeptId(ShiroUtils.getSysUser().getDeptId());
        property.setCreateBy(ShiroUtils.getLoginName());
        property.setUpdateBy(ShiroUtils.getLoginName());

        return propertyMapper.insertProperty(property);
    }


    @Override
    public Property selectPropertyId(String id)
    {

        return propertyMapper.selectPropertyId(id);
    }



    @Override
    public int updateProperty(Property property)
    {
        return propertyMapper.updateProperty(property);
    }

    @Override
    public int updatePropertyStatus(String ids) {

        return propertyMapper.updatePropertyStatus(ids);
    }


}
